﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace PLCS.App.Shared.Views.UserControls
{
    public delegate void Mydega(List<Message> ms);  
    
    public class StaticClass
    {
        public static List<Message> messages = new List<Message>();
        public static int i = 0;
        public static event Mydega Myevent;
        public static void Run()
        {
            if (i == 0)
            {
                i = 1;
                Task.Run(() => 
                {
                    while (true) 
                    {
                        Thread.Sleep(1000);
                        Myevent(new List<Message>() { });
                    }
                });
            }
           
        }
    }
    public class Message
    { 
        public string code { get; set; }
        public string message { get; set; }
    }

}
